var businessReturn = {};
businessReturn.methods = {};

$(function(){
    // 订单信息列表
    businessReturn.methods.dataGrid();
    // 退款按钮
    businessReturn.methods.returnBtn();

})

// 订单信息列表
businessReturn.methods.dataGrid = function(){
    var d = [
        {ShopMessage:"全套2册【汪涵推荐】人间草木+浮生六记 汪曾祺全集经典民国名家散文学随笔小说作品集 畅销书籍排行榜",WaresQty:"36.00",WaresCount:"1",ReceiverName:"6.00",BuyerNick:"¥30.00"},
        {ShopMessage:"全套2册【汪涵推荐】人间草木+浮生六记 汪曾祺全集经典民国名家散文学随笔小说作品集 畅销书籍排行榜",WaresQty:"36.00",WaresCount:"1",ReceiverName:"6.00",BuyerNick:"¥30.00"},
        {ShopMessage:"全套2册【汪涵推荐】人间草木+浮生六记 汪曾祺全集经典民国名家散文学随笔小说作品集 畅销书籍排行榜",WaresQty:"36.00",WaresCount:"1",ReceiverName:"6.00",BuyerNick:"¥30.00"}
    ]
    Controller.GridControl.Bind(d, ".shop-returnMoney-order-con", {
        ShopMessage: {
            cnName: "商品详情",
            index: 0,
            width:"390px",
            converter:spxqConvert
        },
        WaresQty: {
            cnName: "单价",
            index: 1,
            width:"124px"
        },
        WaresCount: {
            cnName: "数量",
            index: 2,
            width:"122px"
        },
        ReceiverName: {
            cnName: "优惠",
            index: 3,
            width:"106px"
        },
        BuyerNick: {
            cnName: "实付",
            index: 4,
            width:"136px"
        }

    },false,false); 
}
//转换器
function spxqConvert(val) {
    var _html = '<div class="shop-returnMoney-order-xpxq shop-clear">\
                    <a href="javascript:void(0);" class="shop-returnMoney-orderImg"><img src="../../images/upload/shop_user_book1.png"></a>\
                    <a href="javascript:void(0);" class="shop-returnMoney-order-info">全套2册【汪涵推荐】人间草木+浮生六记 汪曾祺全集经典民国名家散文学随笔小说作品集 畅销书籍排行榜</a>\
                </div>';
    return _html;
}



// 退款按钮
businessReturn.methods.returnBtn = function(){
    $(".shop-returnMoney-steps-right").on("click",".shop-returnMoney-btn",function(){
        $(this).addClass("shop-return-btnClick").siblings().removeClass("shop-return-btnClick");
        Message.Show("提示", "您确认要退货退款吗?", true, false, false, "sureCancle",returnMoneySaveFun,returnMoneyCloseFun);
    })

    $(".shop-returnMoney-steps-right").on("click",".shop-cancelMoney-btn",function(){
        $(this).addClass("shop-return-btnClick").siblings().removeClass("shop-return-btnClick");
        Message.Show("提示",null, true, false, false, "sureCancle",cancelMoneySaveFun,cancelMoneyCloseFun).setHtml(
                '<div class="cancelMoney" style="margin-top: -18px; height: 60px !important; margin-bottom:25px !important;"> \
                    <span style="vertical-align:top; margin-right: 6px; line-height:1.2;">拒绝退款原因:</span>\
                    <textarea style="width:342px; height:65px; padding:10px 0 0 10px; border:1px #e1e1e1 solid;"></textarea>\
                </div>'        
        );
    })
}
// 回调函数
function returnMoneySaveFun(){
    return true;
}
function returnMoneyCloseFun(){
    return true;
}
function cancelMoneySaveFun(){
    return true;
}
function cancelMoneyCloseFun(){
    return true;
}


